
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div class="contents">
    <!--<h2>Project Management</h2>-->
    <div class="project_management">
        <div class="project_management_2">
            <form id="search" name="frm" action="projectmanage" method="post">
                <select name="key" >
                    <option value="ProjectName">Project Name</option>
                    <option value ="Description">Description</option>
                </select>
                <input type="searchProject" name="value" placeholder="Search...">
                <input class="btn_search" type="submit" name="submit" value="Search">
            </form>

        </div>
        <div id="post_management">
            <table>
                <tr class="title">
                    <td>ID</td>
                    <td class="project_name">Project Name</td>
                    <td class="date">Start Date</td>
                    <td class="description">Description</td>
                    <td class="duration">Duration</td>
                    <td class="type">Type</td>
                    <td class="curator">User Joined</td>
                    <td class="add_user">AddUser</td>
                    <td id="col_user_delete">Delete</td>

                </tr>
                <c:forEach items="${projectList}" var="projectList">
                    <tr>
                        <td class="id">${projectList.getProjectID()}</td>
                        <td class="project_name"><a href="/JudiBlog/projectmanage?action=requestEdit&id=${projectList.getProjectID()}">${projectList.getProjectName()}</a></td>
                        <td class="date">${projectList.getStartDate()}</td>
                        <td class="description">${projectList.getDescription()}</td>
                        <td class="duration">${projectList.getDuration()} day</td>
                        <td class="type">${projectList.getType().getTypeName()}</td>
                        <td class="curator"><c:forEach items="${projectList.getUserList()}" var="userList">
                                ${userList.getUserName()},
                            </c:forEach>
                        </td>
                        </td>
                        <td class="add_user">
                            <a href="javascript:void(0);" onClick=window.open("/JudiBlog/postproject?id=${projectList.getProjectID()}","Ratting","width=650,height=450,toolbar=0,status=0");>add</a>
                        </td>
                        <td class="col_user_delete">
                            <a href="/JudiBlog/projectmanage?action=deleteProject&id=${projectList.getProjectID()}" onclick="return confirmDelete()"><img src="/JudiBlog/img/delete.png" alt="delete"/></a>

                        </td>
                    </tr>

                </c:forEach>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript" language="javaScript">
    function del(id) {
        if (confirm("Are you sure you want to delete this Project?")) {
            window.location.href = "/JudiBlog/projectmanage?action=deleteProject&id=" + id;
        }
        document.form1.action("/JudiBlog/projectmanage?action=deleteProject&id=" + id);
    }
</script>